package com.springboot.fwwb09.controller;

import com.springboot.fwwb09.entity.gzbj;
import com.springboot.fwwb09.service.gzbjService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
//ResponseBody+@Controller=@RestController

//故障报警的方法
@RestController
@RequestMapping("gzbj")
//支持跨域
@CrossOrigin
public class gzbjController {
    @Autowired
    private gzbjService gzbjService;
    //    查询所有的方法
    @GetMapping("findAll")
    public List<gzbj> findAll() {
        List<gzbj> gzbj = gzbjService.findAll();
        return gzbj;
    }
}
